﻿using Atha.Contracts;

namespace Atha
{
	public class ErrorTestResult : ITestRunTestResult
	{
		public ErrorTestResult(string errorMessage)
		{
			this.Name = errorMessage;
		}

		public string Name { get; private set; }

		public bool Has(ITestRunTestResultStatus testRunTestResultStatus)
		{
			return this.Is(testRunTestResultStatus);
		}

		public bool Is(ITestRunTestResultStatus testRunTestResultStatus)
		{
			return Athacore.BuiltIn.TestStatus.Error.Equals(testRunTestResultStatus) ||
				   Athacore.BuiltIn.TestStatus.Failed.Equals(testRunTestResultStatus);
		}
	}
}